import React, { Component } from "react";

export default class Parent extends Component {
  render() {
    return (
      <>
        <h2>Parent</h2>
        <A name="wukong" age={20} sex="male" />
      </>
    );
  }
}

class A extends Component {
  render() {
    const { name, age, sex } = this.props;
    return (
      <>
        <h3>A Child</h3>
        <div>{name}</div>
        <div>{age}</div>
        <div>{sex}</div>
      </>
    );
  }
}
